<# # It is recommended to test the script on a local machine for its purpose and effects. # ManageEngine Endpoint Central will not be responsible for any # damage/loss to the data/setup based on the behavior of the script. # Description: Script is designed to delete computer & user based temp files available on a machine # Configuration Type - COMPUTER #> #Extract Username $name = (Get-WMIObject -ClassName Win32_ComputerSystem).Username $username=$name.split("\")[1]   #Delete C:\Windows\Temp folder Remove-Item -Path "C:\Windows\Temp" -Recurse -Force -ErrorAction SilentlyContinue   #Delete C:\Users\$username\AppData\Local\Temp folder $localTempPath = "C:\Users\$username\AppData\Local\Temp" Remove-Item -Path $localTempPath -Recurse -Force -ErrorAction SilentlyContinue